<extend name="./public/frame.html"/>
<block name="content">
	<blockquote class="layui-elem-quote search">
		<div class="layui-inline">
			<select id="time_type" name="time_type" class="layui-input"lay-filter="time_type" style="width: 120px;">
				<option value="1">生成时间</option>
				<option value="2">注册时间</option>
			</select>
		</div>
		<div class="layui-inline">
			<input type="text" class="layui-input" id="start_time" placeholder="起始时间">
		</div>
		<div class="layui-inline">
			<input type="text" class="layui-input" id="end_time" placeholder="结束时间">
		</div>
		<div class="layui-inline">
			<input type="text" name="driver_phone" id="driver_phone" placeholder="司机手机号" class="layui-input">
		</div>
		<div class="layui-inline">
			<select id="record_type" name="record_type" class="layui-input"lay-filter="record_type" style="width: 150px;">
				<option value="">金额类型</option>
				<?php foreach($driver_flow_type_list as $key=>$value):?>
				<option value="<?php echo $key;?>"><?php echo $value;?></option>
				<?php endforeach;?>
			</select>
		</div>
		<div class="layui-inline">
			<select id="driver_type" name="driver_type" class="layui-input"lay-filter="driver_type" style="width: 120px;">
				<option value="">司机类型</option>
				<option value="1">快车司机</option>
				<option value="2">城际司机</option>
			</select>
		</div>
		<div class="layui-inline">
			<button class="layui-btn" data-type="search">搜索</button>
		</div>
	</blockquote>
	<table class="layui-table" lay-data="{width:'auto', height:'auto', url:'{:url('driver/driverFlowList')}', page: true, limit: 10, id:'userFlowList'}" lay-filter="driverFlowList">
		<thead>
		<tr>
			<th lay-data="{field:'id', width:120,fixed: true, sort: true,align:'center',fixed: true}">ID</th>
			<th lay-data="{field:'driver_id', width:120,align:'center'}">司机ID</th>
			<th lay-data="{field:'driver_phone', width:120,align:'center'}">手机号</th>
			<th lay-data="{field:'register_time', width:160,align:'center'}">注册时间</th>
			<th lay-data="{field:'money', width:150,align:'center'}">金额</th>
			<th lay-data="{field:'order_sn', width:200,align:'center'}">单号</th>
			<th lay-data="{field:'record_type', width:150,align:'center'}">金额类型</th>
		</tr>
		</thead>
	</table>
	<script>
		// && d.activity_type !=2
		layui.use(['form','table','laydate'], function () {
			var table = layui.table,form = layui.form,laydate = layui.laydate;
			laydate.render({
				elem: '#start_time' //指定元素
			});

			laydate.render({
				elem: '#end_time' //指定元素
			});
			table.on('tool(driverFlowList)', function (obj) {
				var data = obj.data;
				var id = data.id;
			});

			//搜索
			$('.layui-btn').on('click', function () {
				var time_type 		= $("#time_type").val();
				var start_time 		= $("#start_time").val();
				var end_time 		= $("#end_time").val();
				var driver_phone 	= $("#driver_phone").val();
				var record_type		= $("#record_type").val();
				var driver_type		= $("#driver_type").val();
				table.reload('userFlowList', {
					url: '/admin/Finance/driverFlowList', where: {
						"time_type": time_type,
						"driver_phone": driver_phone,
						"start_time": start_time,
						"end_time": end_time,
						"record_type": record_type,
						"driver_type":driver_type
					}
				});
			});
		});
	</script>
</block>
